﻿CREATE PROCEDURE [dbo].[AddActivityRoleAccess]
	@ActivityRoleAccessId uniqueidentifier,
	@Activity uniqueidentifier,
	@SecurityRole uniqueidentifier,
    @Permissions int,
	@CreatedBy uniqueidentifier,
	@CreatedOn datetime,
    @LastChanged datetime,
	@LastChangedBy uniqueidentifier,

	@TimeStamp timestamp output

AS

	INSERT INTO ActivityRoleAccess

	(ActivityRoleAccessId, Activity, SecurityRole, [Permissions], CreatedBy, CreatedOn, LastChanged, LastChangedBy)

	VALUES 

	(@ActivityRoleAccessId, @Activity, @SecurityRole, @Permissions, @CreatedBy, @CreatedOn, @LastChanged, @LastChangedBy)

	SELECT @TimeStamp = [TimeStamp]

	FROM ActivityRoleAccess WHERE ActivityRoleAccessId = @ActivityRoleAccessId

RETURN 0